package 公司真题.瑛太莱;

import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;

public class _母羊生羊问题 {

    public static void main(String[] args) {
        List<Sheep> list = new LinkedList<>();
        list.add(new Sheep());

        for (int i = 1; i <= 4; i++) {
            for (Sheep sheep : list) {
                sheep.setAge(sheep.getAge() + 1);
            }

            int newSheep = 0;

            for (Sheep sheep : list) {
                int age = sheep.getAge();
                if (age == 2 || age == 4) {
                    newSheep++;
                }
            }

            for (int j = 0; j < newSheep; j++) {
                list.add(new Sheep(1));
            }
        }
        Scanner sc = new Scanner(System.in);
        int aliveSheepCount = 0;
        for (Sheep sheep : list) {
            if (sheep.isLive()) {
                aliveSheepCount++;
            }
        }
        System.out.println(aliveSheepCount);
    }

    static class Sheep {
        int age = 0;

        public Sheep() {

        }

        public Sheep(int age) {
            this.age = age;
        }

        public int getAge() {
            return this.age;
        }

        public void setAge(int age) {
            this.age = age;
        }

        public boolean isLive() {
            return this.age <= 5 ? true : false;
        }
    }
}
